//
//  XMWithdrawTableViewCell.m
//  XunMi
//
//  Created by MacBook on 2024/4/8.
//  Copyright © 2024 TieZhu. All rights reserved.
//

#import "XMWithdrawTableViewCell.h"
#import "XMWithdrawModel.h"

@interface XMWithdrawTableViewCell ()
@property (weak, nonatomic) IBOutlet UILabel *titleLa;
@property (weak, nonatomic) IBOutlet UILabel *stateLa;
@property (weak, nonatomic) IBOutlet UILabel *timeLa;
@property (weak, nonatomic) IBOutlet UILabel *descLa;
@property (weak, nonatomic) IBOutlet UILabel *moneyLa;
@property (weak, nonatomic) IBOutlet UILabel *contentLa;

@end

@implementation XMWithdrawTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
}

- (void)setModel:(XMWithdrawModel *)model {
    _model = model;
    self.titleLa.text = kStringFormat(@"提现%@元", model.money);
    self.moneyLa.text = kStringFormat(@"+%@元", model.amount);
    self.timeLa.text = model.create_time;
    if (model.status == 3) {
        self.moneyLa.hidden = NO;
        self.descLa.hidden = NO;
        self.contentLa.hidden = YES;
    } else {
        self.moneyLa.hidden = YES;
        self.descLa.hidden = YES;
        self.contentLa.hidden = NO;
    }
    self.stateLa.layer.borderWidth = 1;
    // 0 等待审核  1 审核通过  2 审核拒绝  3 提现到账  4 提现失败
    switch (model.status) {
        case 0:
        {
            self.stateLa.text = @"等待审核";
            self.stateLa.backgroundColor = kHEX(@"#FFF7EE");
            self.stateLa.textColor = kHEX(@"#F38805");
            self.stateLa.layer.borderColor = kHEX(@"#F38805").CGColor;
            self.contentLa.text = @"等待后台审核！";
        } break;
            
        case 1:
        {
            self.stateLa.text = @"审核通过";
            self.stateLa.backgroundColor = kHEX(@"#FFF7EE");
            self.stateLa.textColor = kHEX(@"#F38805");
            self.stateLa.layer.borderColor = kHEX(@"#F38805").CGColor;
            self.contentLa.text = @"审核通过即将到账！";
            
        } break;
            
        case 2:
        {
            self.stateLa.text = @"审核拒绝";
            self.stateLa.backgroundColor = kHEX(@"#FFEAEC");
            self.stateLa.textColor = kHEX(@"#FF0023");
            self.stateLa.layer.borderColor = kHEX(@"#FF0023").CGColor;
            self.contentLa.text = @"后台审核拒绝，具体请联系客服！";
            
        } break;
            
        case 3:
        {
            self.stateLa.text = @"提现成功";
            self.stateLa.backgroundColor = kHEX(@"#E1F3DB");
            self.stateLa.textColor = kHEX(@"#3AD400");
            self.stateLa.layer.borderColor = kHEX(@"#3AD400").CGColor;
            self.contentLa.text = @"";
        } break;
            
        case 4:
        {
            self.stateLa.text = @"提现失败";
            self.stateLa.backgroundColor = kHEX(@"#F5F5F5");
            self.stateLa.textColor = kHEX(@"#A9A9A9");
            self.stateLa.layer.borderColor = kHEX(@"#A9A9A9").CGColor;
            self.contentLa.text = @"提现失败，积分已退还！";
        } break;
            
        default:
            break;
    }
}

@end
